﻿
@{
    Layout = null;
}
<script src="~/Scripts/jquery-1.10.2.min.js"></script>
    @*<meta name="viewport" content="width=device-width" />*@
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1.0" />
    <title>登陆页面</title>
    @*<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />*@
    <link href="~/Content/bootstrap.min.css" rel="stylesheet" />
    <link href="~/Content/login.css" rel="stylesheet" />

<body>
    <div class="box">
        <div class="login-box">
            <div class="login-title text-center">
                <h1><small>登录</small></h1>
            </div>
            <div class="login-content ">
                <div class="form">
                    <form action="#" method="post">
                        <div class="form-group">
                            <div class="col-xs-12  ">
                                <div class="input-group">
                                    <span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span>
                                    <input type="text" id="username" name="username" class="form-control" placeholder="用户名">
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-xs-12  ">
                                <div class="input-group">
                                    <span class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span>
                                    <input type="password"  id="password" name="password" class="form-control" placeholder="密码">
                                </div>
                            </div>
                        </div>
                        <div class="form-group form-actions">
                            <div class="col-xs-4 col-xs-offset-4 ">
                                <button type="button" onclick="Login()" id="btnLogin" class="btn btn-sm btn-info"><span class="glyphicon glyphicon-off"></span> 登录</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</body>
<script type="text/javascript">
    function Login() {
       // window.location = "/Admin/index";
        var username = $("#username").val();
        //alert(username);
        var password = $("#password").val();
        $.ajax({
            type: "POST",
            url: "Login/Login",
            data: {
                username: username,
                password: password
            },
            success: function (data) {
                //alert(msg);
                if (data.success) {
                    window.location = "/Admin/index";
                    //window.location = "http://www.baidu.com";
                }
                   
            }
            
        });
        // alert("删除方法体");
    }
</script>

